﻿using System;
using System.Collections.Generic;

namespace GwLib.JqGridMvc
{
    public enum GroupOperator
    {
        And = 0,
        Or
    }

    public enum SearchOperator
    {
        Equal = 0,
        NotEqual,
        Less,
        LessOrEqual,
        Greater,
        GreaterOrEqual,
        BeginsWith,
        DoesNotBeginWith,
        IsIn,
        IsNotIn,
        EndsWith,
        DoesNotEndWith,
        Contains,
        DoesNotContain
    }

    public interface IGridSearchFilterEntry
    {
        string SearchString { get; set; }
        SearchOperator SearchOperator { get; set; }
        string SearchField { get; set; }
    }

    public interface IGridSearchFilter
    {
        GroupOperator GroupOperator { get; set; }
        IList<IGridSearchFilterEntry> SearchEntries { get; set; }
    }

    public interface IGridDataParameters
    {
        DateTime? RequestTime { get; set; }
        int RecordsPerPage { get; set; }
        int PageNumber { get; set; }
        string SortField { get; set; }
        bool SortAscending { get; set; }
        string SecondarySortField { get; set; }
        bool SecondarySortAscending { get; set; }
        bool IsSearchRequest { get; set; }
        string SearchField { get; set; }
        string SearchString { get; set; }
        SearchOperator SearchOperator { get; set; }
        int? TotalRecordCount { get; set; }
        string FilterString { get; set; }
        IList<IGridSearchFilter> Filters { get; set; }
    }
}
